package main

import "fmt"

// switch fallthrough
// 在 C、Java、JavaScript 等语言中， 下降是 switch 语句各个分支的默认行为。使用break跳出。
// 但是Go 对此采取了更为谨慎的做法， 用户需要显式地使用 fallthrough 关键字才会引发下降。

func main() {
	var room = "lake"

	switch room {
	case "cave":
		fmt.Println("You find yourself in a dimly lit cavern.")
	case "lake":
		fmt.Println("The ice seems solid enough.")
		fallthrough
	case "underwater":
		fmt.Println("The water is freezing cold.")
	}

	// 输出
	// The ice seems solid enough.
	// The water is freezing cold.
}
